package com.xjust.Mapper;

import com.github.pagehelper.Page;
import com.xjust.pojo.ResponseData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface RegisterMapper {
    //获取最大病历号
    Integer selectMaxCaseNumber();

    Integer selectDoctorUsedNumber(Integer doctorId);

    void insertRegister(Map<String,Object> register);
    @Select("select count(*) from register where employee_id = #{employeeId} and visit_state = 3 and  date(visit_date) = date(now())")
    Integer selectCountByEmployeeIdAndVS(Integer employeeId);
    @Select("select count(*) from register where employee_id = #{employeeId} and visit_state = 1 and date(visit_date) = date(now())")
    Integer selectWaitCountByEmployeeIdAndVS(Integer employeeId);

    Page<Map<String, Object>> selectRegisterById(Integer[] registIdList,@Param("realName") String realName, @Param("caseNumber") String caseNumber);

    Page<Map<String, Object>> selectPatientByPage(Integer[] list, String caseNumber,
                                                  String realName);
    Page<Map<String, Object>> selectWaitPatientByPage(Integer employeeId, String caseNumber, String realName,Integer visitState);

    void updateVisitState(Object register_id);
    ResponseData getPatientToToll(String caseNumber, String realName);

    void updateRegisterState(Object caseNumber);

    Integer getRegisterIdByCaseNumber(Object caseNumber);


    List<Map<String, Object>> getPatientInfo(Integer[] ids,String case_number,String real_name);
}
